package com.example.play.api

import com.example.common.api.BaseApiService
import com.example.common.entity.BaseResponse
import com.example.common.entity.CommendEntity
import com.example.common.entity.DanmuEntity
import com.example.common.entity.MovieVideoEntity
import com.example.common.entity.SimpleVideoEntity
import com.example.play.entity.AuthorEntity
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface PlayApiServer:BaseApiService {
    //获取视频作者信息
    @GET("/videoauthor/getAuthorById")
    suspend fun getAuthorById(@Query("userid") userid:String):BaseResponse<AuthorEntity>
    //获取首页推荐视频
    @GET("/videosimple/getRecommendSimpleVideo")
    suspend fun getRecommendSimpleVideo(@Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<SimpleVideoEntity>>
    //获取首页分类下的视频
    @GET("/videosimple/getSimpleVideoByChannelId")
    suspend fun getSimpleVideoByChannelId(@Query("channelId") channelId: String ,@Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<SimpleVideoEntity>>
    //获取放映厅推荐视频
    @GET("/videomulti/getRecommendMutilVideo")
    suspend fun getRecommendMutilVideo(@Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<MovieVideoEntity>>

    //获取放映厅分类下视频
    @GET("/videomulti/getMutilVideoByTypeId")
    suspend fun getMutilVideoByTypeId(@Query("typeid") typeid: Int ,@Query("page") page: Int, @Query("pagesize") pageSize: Int): BaseResponse<List<MovieVideoEntity>>

    //获取视频评论
    @GET("/comment/getCommentByUserId")
    suspend fun getVideoCommends(@Query("datatype") dataType: Int, @Query("itemid") itemId: String): BaseResponse<List<CommendEntity>>

    //发布评论
    @POST("/comment/publishComment")
    suspend fun publishComment(@Body body: RequestBody): BaseResponse<CommendEntity>

    //发布弹幕
    @POST("/bulletscreen/publishBulletScreen")
    suspend fun publishDanmuMsg(@Body body: RequestBody): BaseResponse<String>

    //获取弹幕
    @GET("/bulletscreen/getBulletScreenInfo")
    suspend fun getVideoDanmuMsg(@Query("datatype") datatype: Int,@Query("itemid") itemid: String): BaseResponse<List<DanmuEntity>>
}